<?
	 layout("/inc/win_layout.html",{title:sysTitle}){
    ?>



<!--END TITLE & BREADCRUMB PAGE-->
<!--BEGIN CONTENT-->
<div class="page-content">


	<div class="row mbl">
		<div class="col-lg-6">
			<div class="input-group input-group-sm mbs">
				<span class="input-group-btn"> <select id="queryParams"
					data-toggle="dropdown" class="btn btn-danger dropdown-toggle"
					style="width :100px;">
						<option value="-1">
							筛选项&nbsp;<span class="caret"></span>
						</option>
						<option value="username">用户名</option>
						<option value="nickname">昵称</option>
						<option value="mobilephone">手机号</option>
				</select> </span> <input id="text" type="text" placeholder="请输入关键词..."
					class="form-control" /><span class="input-group-btn"><button
						type="button" data-toggle="dropdown"
						class="btn btn-success dropdown-toggle" onclick="get()">搜索</button>
				</span>
			</div>
		</div>
	</div>

	<table
		class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
		<thead>
			<tr>
				<th>序号</th>
				<th>用户名</th>
				<th>昵称</th>
				<th>手机号</th>
				<th>创建时间</th>
				<th>状态</th>
				<th>所属机构</th>

			</tr>
		</thead>
		<tbody id="findMemeber">
		</tbody>
	</table>
	<div id="dataNull" class="panel-body"
		style="height: 90px; line-height: 50px;" align="center"></div>
	<div id="page2" style="text-align: center; margin-top: 20px;"></div>
</div>

<!--END CONTENT-->
</div>


<?} ?>
<script>

	function getQueryString(name) { 
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r != null) return unescape(r[2]); return null; 
	} 
	var winName=getQueryString("winName");
	var curr;
	var  memberid= window.parent.getlay();
	
	$(function() {
		
		demo1(1);
	});
	function get() {
		demo1(curr);
	}

	function getindex() {
		return memberid;
	}
	
	function demo1(curr) {
		$.getJSON(
						"organizationUserSeach.do",
						{
							page : curr || 1,
							queryParams : $("#queryParams").val(),
							text : $("#text").val(),
							type : 2,
							memberId : memberid
						},
						function(res) {
							//此处仅仅是为了演示变化的内容
							var str = "";
							$("#findMemeber").html("");
							if (res.listsize > 0) {
								$("#dataNull").html("");
							} else {
								$("#dataNull")
										.html(
												"<span class='subtitle' style='font-size: 15px;'>数据为空!</span>");
							}
							for ( var i = 0; i < res.listsize; i++) {
								var statusname;
								if (res.result[i].status == 0) {
									statusname = "启用";
								} else {
									statusname = "禁用";
								}
								
								str += "<tr><td>" + (i + 1)
										+ "</td><td> <label id=>"
										+ res.result[i].username
										+ "</label></td><td><label >"
										+ res.result[i].nickname
										+ "</label></td><td><label >"
										+ res.result[i].mobilephone
										+ "</label></td><td><label >"
										+ res.result[i].createTime
										+ "</label></td><td><label >"
										+ statusname + "</label></td><td>"
										+ res.result[i].departmentName+ "</label></td></tr>";
							}
							$("#findMemeber").append(str);

							laypage({
								cont : document.getElementById('page2'), //容器。值支持id名、原生dom对象，jquery对象,
								pages : res.pageSize, //总页数
								skip : true, //是否开启跳页
								skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
								curr : curr || 1,
								last: res.pageSize,
								groups : 6,//连续显示分页数
								jump : function(obj, first) { //触发分页后的回调
									if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
										demo1(obj.curr);
										var curr = obj.curr;
										curr = obj.curr;
									}
								}
							});
						});
	};
	
</script>